@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
check_required_components("@PROJECT_NAME@")

# in theory with lines above you can write smth like:
# target_link_libraries (target brainflow::GetData brainflow::BoardController)
# directly in dependend package CMakeLists.txt after find_package
# but it doesn't link libraries so it leads to linking error and I have no idea why
# workaround - set variables for include and library path and use these variables in package consumer code

set (@PROJECT_NAME@_INCLUDE_DIRS @PACKAGE_INC_INSTALL_DIR@)
set (@PROJECT_NAME@_LIBRARY_DIRS @PACKAGE_LIB_INSTALL_DIR@)

if (CMAKE_SIZEOF_VOID_P EQUAL 8)
    MESSAGE ("64 bits compiler detected")
    SET (PLATFORM_ACH "X64")
    SET (BOARD_CONTROLLER_NAME "BoardController" "libBoardController")
    SET (DATA_HANDLER_NAME "DataHandler" "libDataHandler")
    SET (BRAINFLOW_NAME "Brainflow" "libBrainflow")
else (CMAKE_SIZEOF_VOID_P EQUAL 8)
    MESSAGE ("32 bits compiler detected")
    SET (PLATFORM_ACH "X86")
    SET (BOARD_CONTROLLER_NAME "BoardController32" "libBoardController32")
    SET (DATA_HANDLER_NAME "DataHandler32" "libDataHandler32")
    SET (BRAINFLOW_NAME "Brainflow32" "libBrainflow32")
endif (CMAKE_SIZEOF_VOID_P EQUAL 8)

find_library (
    BoardControllerPath
    ${BOARD_CONTROLLER_NAME}
    PATHS @PACKAGE_LIB_INSTALL_DIR@
)

find_library (
    DataHandlerPath
    ${DATA_HANDLER_NAME}
    PATHS @PACKAGE_LIB_INSTALL_DIR@
)

find_library (
    BrainflowPath
    ${BRAINFLOW_NAME}
    PATHS @PACKAGE_LIB_INSTALL_DIR@
)
